<include file="public:top" />
<!--编辑菜单-->
<form class="layui-form layui-form-pane" action="" style="padding:20px;">
	<input type="hidden" name="pid" />
	<input type="hidden" name="id" value="{$info.id}" />
  <div class="layui-form-item">
    <label class="layui-form-label">上级分类</label>
    <div class="layui-input-block">
      <select name="pid">
    		<option value="0">顶级分类</option>
    		<volist name="catelist" id="val" >
    			<option value="{$val.id}" <if condition="$info['pid'] eq $val['id']"> selected=""</if>>{$val.name}</option>
    				<volist name="val['erji']" id="vo">
    					<option value="{$vo.id}" <if condition="$info['pid'] eq $vo['id']"> selected=""</if>>&nbsp;&nbsp;&nbsp;├─ {$vo.name}</option>
    				</volist>
    		</volist>
	   </select>
    </div>
  </div>
 
  <div class="layui-form-item">
    <label class="layui-form-label">分类名称</label>
    <div class="layui-input-block">
      <input type="text" name="name" id="name" lay-verify="name" value="{$info.name}" placeholder="请输入" class="layui-input" >
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">排序</label>
    <div class="layui-input-block">
      <input type="number" name="ordid" id="ordid" lay-verify="ordid" placeholder="请输入" class="layui-input" value="{$info.ordid}">
    </div>
  </div>
   
   
   
  <div class="layui-form-item"  pane="">
    <label class="layui-form-label">{:L('enabled')}</label>
    <div class="layui-input-block">
      <input type="radio" title="{:L('yes')}" name="status" value="1" <if condition="$info.status eq 1">checked</if>>
      <input type="radio" title="{:L('no')}" name="status" value="0" <if condition="$info.status eq 0">checked</if>>
    </div>
  </div>
  <div class="layui-form-item">
        <label class=""></label>
        <div class="layui-input-block">
        <button class="layui-btn" lay-submit="" lay-filter="content_edit">提交保存</button>
        </div>
    </div>
</form>

<script type="text/javascript" src="__PUBLIC__/admin/layui/layui.js"></script>
<script>
layui.use(['layer','jquery','form','element'], function () {
   // 操作对象
    var layer = layui.layer,$ = layui.jquery,form = layui.form, element = layui.element;
  	//验证表单
  	form.verify({
	  name: function(value, item){ //value：表单的值、item：表单的DOM对象
	    if(!new RegExp("^[a-zA-Z0-9_\u4e00-\u9fa5\\s·]+$").test(value)){
	      return '不能有特殊字符';
	    }
	    if(/(^\_)|(\__)|(\_+$)/.test(value)){
	      return '首尾不能出现下划线\'_\'';
	    }
	    if(/^\d+\d+\d$/.test(value)){
	      return '不能全为数字';
	    }
	  }
  	  
	});    
    // 提交
    Oper.initUpdate(layui, '文档分类', 'content_edit', 'doc_cate/edit');
});
</script>